/**
 * Copyright (c) 2013-2020, tanghailan (tanghailan@88.com).
 *
 * <p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a copy of the License at
 *
 * <p>http://www.apache.org/licenses/LICENSE-2.0
 *
 * <p>Unless required by applicable law or agreed to in writing, software distributed under the
 * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing permissions and
 * limitations under the License.
 */
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * <b>test.java</b></br>
 *
 * <pre></pre>
 *
 * @author tanghailan tanghailan@88.com
 * @date 2021年03月06日 11:46:07
 * @since JDK 1.8
 */
public class test1 {

  public static void main(String[] args) {
    String json =
        "{\"data\":[{\"REGION_ID\":\"546\",\"START_TIME\":\"2021-12-12 10:00\",\"YS_ADDRESS\":\"轻工南五街7号翠影华庭共享小屋\",\"CREATE_NAME\":\"东便社区\",\"SQ_ID\":\"671\",\"IS_DELETE\":0,\"SQ_NAME\":\"东便社区\",\"CODE\":\"YS20211212152240\",\"CURRENT_STATE\":\"方案表决\",\"ID\":222,\"CREATE_TIME\":\"2021-12-12 15:22:41\",\"YS_NAME\":\"更换翠影华庭小区党支部成员\",\"CREATE_ID\":155},{\"REGION_ID\":\"546\",\"START_TIME\":\"2021-12-12 09:30\",\"YS_ADDRESS\":\"轻工南五街7号翠影华庭小区共享小区\",\"CREATE_NAME\":\"东便社区\",\"SQ_ID\":\"671\",\"IS_DELETE\":0,\"SQ_NAME\":\"东便社区\",\"CODE\":\"YS20211211112122\",\"CURRENT_STATE\":\"方案表决\",\"ID\":221,\"CREATE_TIME\":\"2021-12-11 11:21:22\",\"YS_NAME\":\"关于翠影华庭小区楼道长人选表决\",\"CREATE_ID\":155},{\"REGION_ID\":\"38\",\"START_TIME\":\"2021-12-10 11:05\",\"YS_ADDRESS\":\"1111\",\"CREATE_NAME\":\"农彩妹\",\"SQ_ID\":\"100\",\"IS_DELETE\":0,\"SQ_NAME\":\"东园社区\",\"CODE\":\"YS20211210110549\",\"CURRENT_STATE\":\"讨论协商\",\"ID\":220,\"CREATE_TIME\":\"2021-12-10 11:05:49\",\"YS_NAME\":\"1\",\"CREATE_ID\":3038514},{\"REGION_ID\":\"440604010\",\"START_TIME\":\"2021-10-20 14:49\",\"YS_ADDRESS\":\"1\",\"CREATE_NAME\":\"张一帆\",\"SQ_ID\":\"cb1431de9d1ef01f24b95c7d887899c0\",\"IS_DELETE\":0,\"SQ_NAME\":\"东平智慧党建\",\"CODE\":\"YS20211020144939\",\"CURRENT_STATE\":\"讨论协商\",\"ID\":219,\"CREATE_TIME\":\"2021-10-20 14:49:40\",\"YS_NAME\":\"1\",\"CREATE_ID\":3038692},{\"REGION_ID\":\"440604010\",\"START_TIME\":\"2021-10-20 14:48\",\"YS_ADDRESS\":\"1\",\"CREATE_NAME\":\"张一帆\",\"SQ_ID\":\"cb1431de9d1ef01f24b95c7d887899c0\",\"IS_DELETE\":0,\"SQ_NAME\":\"东平智慧党建\",\"CODE\":\"YS20211020144829\",\"CURRENT_STATE\":\"讨论协商\",\"ID\":218,\"CREATE_TIME\":\"2021-10-20 14:48:29\",\"YS_NAME\":\"1\",\"CREATE_ID\":3038692},{\"REGION_ID\":\"38\",\"START_TIME\":\"2021-10-12 09:00\",\"YS_ADDRESS\":\"保安社区居委会\",\"CREATE_NAME\":\"保安社区\",\"SQ_ID\":\"129\",\"IS_DELETE\":0,\"SQ_NAME\":\"保安社区\",\"CODE\":\"YS20211011155850\",\"CURRENT_STATE\":\"方案表决\",\"ID\":216,\"CREATE_TIME\":\"2021-10-11 15:58:51\",\"YS_NAME\":\"关于四期3-5座负一负二层侧门新增人脸识别项目会议\",\"CREATE_ID\":230},{\"REGION_ID\":\"546\",\"START_TIME\":\"2021-09-10 09:00\",\"YS_ADDRESS\":\"金沙居委会会议室\",\"CREATE_NAME\":\"金沙社区\",\"SQ_ID\":\"672\",\"IS_DELETE\":0,\"SQ_NAME\":\"金沙社区\",\"CODE\":\"YS20210909174232\",\"CURRENT_STATE\":\"讨论协商\",\"ID\":214,\"CREATE_TIME\":\"2021-09-09 17:42:33\",\"YS_NAME\":\"商讨是否对金沙新城小区树木进行修剪\",\"CREATE_ID\":163},{\"REGION_ID\":\"545\",\"START_TIME\":\"2021-09-07 14:30\",\"YS_ADDRESS\":\"南庄镇河畔社区水悦龙湾二楼共享小屋\",\"CREATE_NAME\":\"河畔社区\",\"SQ_ID\":\"650\",\"IS_DELETE\":0,\"SQ_NAME\":\"河畔社区\",\"CODE\":\"YS20210907114743\",\"CURRENT_STATE\":\"已结束\",\"ID\":212,\"CREATE_TIME\":\"2021-09-07 11:47:43\",\"YS_NAME\":\"商讨快递小哥红色驿站建设能源铁塔事宜\",\"CREATE_ID\":90},{\"REGION_ID\":\"38\",\"START_TIME\":\"2021-09-07 15:00\",\"YS_ADDRESS\":\"社区三楼会议室\",\"CREATE_NAME\":\"卫国社区\",\"SQ_ID\":\"128\",\"IS_DELETE\":0,\"SQ_NAME\":\"卫国社区\",\"CODE\":\"YS20210906175845\",\"CURRENT_STATE\":\"讨论协商\",\"ID\":211,\"CREATE_TIME\":\"2021-09-06 17:58:46\",\"YS_NAME\":\"普澜三街小区金鱼街26号楼下休闲娱乐场地安装挡车栏杆\",\"CREATE_ID\":234},{\"REGION_ID\":\"546\",\"START_TIME\":\"2021-08-03 07:30\",\"YS_ADDRESS\":\"存院围社区融创望江府小区党群活动中心（融创正门进去左手边，物管对面）\",\"CREATE_NAME\":\"存院围社区\",\"SQ_ID\":\"4171\",\"IS_DELETE\":0,\"SQ_NAME\":\"存院围社区\",\"CODE\":\"YS20210802162427\",\"CURRENT_STATE\":\"讨论协商\",\"ID\":208,\"CREATE_TIME\":\"2021-08-02 16:24:27\",\"YS_NAME\":\"融创望江府小区党员见面会及小区议事会\",\"CREATE_ID\":860}],\"errcode\":0,\"errmsg\":\"ok\"}";
    String str =
        "讨论是否申报使用维修资金，对帝景蓝湾1区1座电梯钢丝绳更换|"
            + "融创望江府小区党员见面会及小区议事会|"
            + "测试数据的议事厅|"
            + "测试会议|"
            + "水悦龙湾公租房部分地方照明不足的问题需要解决|"
            + "更换翠影华庭小区党支部成员|"
            + "更换4区4座01-04单元电梯承重钢丝绳和轿厢们防夹光幕|"
            + "普澜三街小区金鱼街26号楼下休闲娱乐场地安装挡车栏杆|"
            + "尚苑五座电梯门安装电动车限行报警器|"
            + "商讨是否对金沙新城小区树木进行修剪|"
            + "商讨快递小哥红色驿站建设能源铁塔事宜|"
            + "南粮小区水管改造问题议事会议|"
            + "南浦新村物业管理费调整会议|"
            + "南浦新村26号垃圾分类亭安装位置征询会|"
            + "加强“五一”期间防控工作会议|"
            + "关于翠影华庭小区楼道长人选表决|"
            + "关于翠影华庭小区垃圾分类亭的选址|"
            + "关于港口路26号18、19座电梯加装空调及智能消防系统的议事会议|"
            + "关于征求海湾城市嘉园小区议事规则（草案） 修改意见|"
            + "关于四期3-5座负一负二层侧门新增人脸识别项目会议|"
            + "关于商议 彩虹路92号1梯（01.02单元）5-6层外墙脱落 使用住宅专项维修资金进行维修事项|"
            + "关于“九鼎国际城小区安装朝天摄像头，防止高空抛物”座谈会|"
            + "党建引领促发展 结对共建聚合力 为辖区内居民实现微心愿|"
            + "兆阳御花园12座维修客梯申请使用维修资金议事会议|"
            + "依云轩小区党支部会议|"
            + "万科广场小区四期4座电梯底坑渗水维修|"
            + "4月25日社区议事协商会议|"
            + "1|"
            + "1|"
            + "1";
    String[] split = str.split("\\|");
    List<String> stringList1 = Arrays.asList(split);
    JSONObject jsonObject = JSONUtil.parseObj(json);
    JSONArray data = jsonObject.getJSONArray("data");
    List<String> stringList = new ArrayList<>();
    List<String> newList = new ArrayList<>();

    for (int i = 0; i < data.size(); i++) {
      stringList.add(data.getJSONObject(i).getStr("YS_NAME"));
    }

    for (String s : stringList1) {
      //
      boolean flag = true;
      for (String newBean : stringList) {
        if (newBean.equals(s)) {
          flag = false;
          break;
        }
      }
      if (flag) {
        newList.add(s);
      }
    }
    System.out.println(newList);
  }
}
